if (this._appIcons[id] !== undefined)
return;
- let appIcon = new AppWellIcon(app);
+ let appIcon = new AppIcon(app);
let pos = Util.insertSorted(this._allApps, app, function(a, b) {
return a.compare_by_name(b);
});
createResultActor: function (resultMeta, terms) {
let app = resultMeta['id'];
- let icon = new AppWellIcon(app);
+ let icon = new AppIcon(app);
return icon.actor;
}
});
+
const AppIcon = new Lang.Class({
Name: 'AppIcon',
- Extends: IconGrid.BaseIcon,
-
- _init : function(app, params) {
- this.app = app;
-
- let label = this.app.get_name();
-
- this.parent(label, params);
- },
-
- createIcon: function(iconSize) {
- return this.app.create_icon_texture(iconSize);
- }
-});
-
-const AppWellIcon = new Lang.Class({
- Name: 'AppWellIcon',
_init : function(app, iconParams) {
this.app = app;
y_fill: true });
this.actor._delegate = this;
- this.icon = new AppIcon(app, iconParams);
+ if (!iconParams)
+ iconParams = {};
+
+ iconParams['createIcon'] = Lang.bind(this, this._createIcon);
+ this.icon = new IconGrid.BaseIcon(app.get_name(), iconParams);
this.actor.set_child(this.icon.actor);
this.actor.label_actor = this.icon.label;
this._removeMenuTimeout();
},
+ _createIcon: function(iconSize) {
+ return this.app.create_icon_texture(iconSize);
+ },
+
_removeMenuTimeout: function() {
if (this._menuTimeoutId > 0) {
Mainloop.source_remove(this._menuTimeoutId);
return this.icon.icon;
}
});
-Signals.addSignalMethods(AppWellIcon.prototype);
+Signals.addSignalMethods(AppIcon.prototype);
const AppIconMenu = new Lang.Class({
Name: 'AppIconMenu',
const DASH_ITEM_HOVER_TIMEOUT = 300;
function getAppFromSource(source) {
- if (source instanceof AppDisplay.AppWellIcon) {
+ if (source instanceof AppDisplay.AppIcon) {
return source.app;
} else {
return null;
},
_createAppItem: function(app) {
- let appIcon = new AppDisplay.AppWellIcon(app,
- { setSizeManually: true,
- showLabel: false });
+ let appIcon = new AppDisplay.AppIcon(app,
+ { setSizeManually: true,
+ showLabel: false });
appIcon._draggable.connect('drag-begin',
Lang.bind(this, function() {
appIcon.actor.opacity = 50;
let item = new DashItemContainer();
item.setChild(appIcon.actor);
- // Override default AppWellIcon label_actor, now the
+ // Override default AppIcon label_actor, now the
// accessible_name is set at DashItemContainer.setLabelText
appIcon.actor.label_actor = null;
item.setLabelText(app.get_name());